import { axios } from '@/utils/requestProcess'
import api from '@/api/apiUrl'
export function applyList (data) {
  return axios({
    url: api.Process.applyList,
    method: 'get',
    params: data
  })
}

export function getAction(url, parameter) {
  return axios({
    url: url,
    method: 'get',
    params: parameter
  })
}

//post
export function processList(parameter) {
  return axios({
    url: api.Process.processList,
    method: 'get',
    data: parameter
  })
}

// 保存申请单
export function saveProcessInfo(parameter) {
  return axios({
    url: api.Process.saveApplyList,
    method: 'post',
    params: parameter
  })
}

// 附件上传
export function uploadImg (parameter) {
  return axios({
    url: api.Process.uploadImg,
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 发起申请
export function applyProcessInfo(parameter) {
  return axios({
    url: api.Process.applySubmit,
    method: 'get',
    params: parameter
  })
}

export function postFormAction (url, parameter) {
  return axios({
    url: url,
    method:'post' ,
    params: parameter
  })
}

/* 审批模块接口 start */
export function getApproveDoneList (data) { // 已办
  return axios({
    url: api.Process.doneList + '?' + data,
    method: 'post'
  })
}

export function getApproveToDoList (data) { // 待办
  return axios({
    url: api.Process.todoList + '?' + data,
    method: 'post'
  })
}

export function approveList (url, params) {
  return axios({
    url: url + '?' + params
  })
}
/* 审批模块接口 end */
